home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / mach / ds3100.md / machMon.c < prev    next >
C/C++ Source or Header  |  1990-02-20  |  3KB  |  111 lines

  1. /* 
  2.  * machMon.c --
  3.  *
  4.  *    Routines to access the PMAX prom monitor.
  5.  *
  6.  *    Copyright (C) 1989 Digital Equipment Corporation.
  7.  *    Permission to use, copy, modify, and distribute this software and
  8.  *    its documentation for any purpose and without fee is hereby granted,
  9.  *    provided that the above copyright notice appears in all copies.  
  10.  *    Digital Equipment Corporation makes no representations about the
  11.  *    suitability of this software for any purpose.  It is provided "as is"
  12.  *    without express or implied warranty.
  13.  */
  14.  
  15. #ifndef lint
  16. static char rcsid[] = "$Header: /sprite/src/kernel/mach/ds3100.md/RCS/machMon.c,v 9.3 90/02/20 14:33:45 shirriff Exp $ SPRITE (DECWRL)";
  17. #endif not lint
  18.  
  19. #include "sprite.h"
  20. #define _MONFUNCS
  21. #include "machMon.h"
  22. #include "machConst.h"
  23. #include "machInt.h"
  24. #include "ctype.h"
  25. #include "mach.h"
  26.  
  27.  
  28. /*
  29.  * ----------------------------------------------------------------------------
  30.  *
  31.  * Mach_MonAbort --
  32.  *
  33.  *     Abort to prom.
  34.  *
  35.  * Results:
  36.  *     None.
  37.  *
  38.  * Side effects:
  39.  *     Aborts to monitor.
  40.  *
  41.  * ----------------------------------------------------------------------------
  42.  */
  43. void
  44. Mach_MonAbort()
  45. {
  46.     mach_MonFuncs.restart();
  47. }
  48.  
  49. /*
  50.  * ----------------------------------------------------------------------------
  51.  *
  52.  * Mach_MonPutChar --
  53.  *
  54.  *     Call the monitor put character routine
  55.  *
  56.  * Results:
  57.  *     None.
  58.  *
  59.  * Side effects:
  60.  *     None.
  61.  *
  62.  * ----------------------------------------------------------------------------
  63.  */
  64. int
  65. Mach_MonPutChar(ch)
  66.     int        ch;
  67. {
  68.     return(Dev_GraphicsPutc(ch));
  69. }
  70.  
  71.  
  72. /*
  73.  * ----------------------------------------------------------------------------
  74.  *
  75.  * Mach_MonReboot --
  76.  *
  77.  *         Reboot the system.
  78.  *
  79.  * Results:
  80.  *     None.
  81.  *
  82.  * Side effects:
  83.  *     System rebooted.
  84.  *
  85.  * ----------------------------------------------------------------------------
  86.  */
  87. void
  88. Mach_MonReboot(rebootString)
  89.     char    *rebootString;
  90. {
  91.     char *bootpath;
  92.     if (*rebootString != '\0') {
  93.     mach_MonFuncs.setenv2("bootpath",rebootString);
  94.     } else {
  95.     bootpath = mach_MonFuncs.getenv2("bootpath");
  96.     if (bootpath == (char *)NULL || *bootpath == '\0') {
  97.         /*
  98.          * Hardware doesn't have a bootpath.
  99.          */
  100.         mach_MonFuncs.setenv2("bootpath",DEFAULT_REBOOT);
  101.         printf("Using default %s\n",DEFAULT_REBOOT);
  102.     }
  103.     /*
  104.      * Otherwise use hardware's bootpath.
  105.      */
  106.     }
  107.     *MACH_USE_NON_VOLATILE |= MACH_NON_VOLATILE_FLAG;
  108.     mach_MonFuncs.autoboot();
  109.     panic("Mach_MonReboot: Reboot failed (I'm still alive aren't I?)\n");
  110. }
  111.